import 'bootstrap/dist/css/bootstrap.min.css';
import 'animate.css';
import './index.css';
import React from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter, Switch, Route, Redirect} from 'react-router-dom';
import LoginPage from './pages/login';
import Loading from "./components/loading";
import AlertBox from "./components/alert/AlertBox";
import AdminPage from "./pages/admin/AdminPage";

//路由在这里配置
const Root = ()=>(
    <BrowserRouter>
        <Switch>
            <Route path='/admin' component={AdminPage}/>
            <Route path='/login' component={LoginPage}/>
            <Route path='/' exact component={()=><Redirect to={'/login'}/>} />
        </Switch>
    </BrowserRouter>
);
ReactDOM.render(<Root/>, document.getElementById('root'));
ReactDOM.render(<AlertBox/>, document.getElementById("alertContainer"));
ReactDOM.render(<Loading/>, document.getElementById("loadingBox"));
